package thread2;

import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @time: 2019/11/22 12:55
 * @author: baozi
 */
@Data
public class threadDemo1 extends Thread {

    public threadDemo1(String name) {
        super(name);
    }

    public threadDemo1( ) {
    }

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"------aaa");
    }

    public static void main(String[] args) {

        List<people> list= new ArrayList<people>(Arrays.asList(new people(1),new people(2),new people(3)));
        //降序
         Collections.sort(list,(h1, h2)-> h2.getAge().compareTo(h1.getAge()));
         Collections.sort(list,(people h1, people h2)-> {return h2.getAge().compareTo(h1.getAge());});

      //  System.out.println(list);
        //Thread.currentThread().setName();
      //  threadDemo1 demo = new threadDemo1();
      //  threadDemo1 demo = new threadDemo1("名字222");
        //demo.sleep(1);
//        demo.setName("名字");

      //  demo.start();
//        System.out.println(Thread.currentThread().getName()+"bbb");
        //demo.run();

        /*()->{}*/
    }
}
